<template>
    <el-dialog v-model="show" title="查看备注" width="35%" align-center @close="handleClose">
        <el-form :model="props.initList" label-width="auto" label-position="top">
            <el-form-item label="采购申请备注">
                <el-input v-model="props.initList.remark" disabled />
            </el-form-item>
            <el-form-item label="采购审批备注">
                <el-input v-model="props.initList.approvalRemark" disabled />
            </el-form-item>
        </el-form>

        <template #footer>
            <div class="dialog-footer">
                <el-button @click="handleClose">关 闭</el-button>
                <!-- <el-button type="primary" @click="handleSubmit()">保 存</el-button> -->
            </div>
        </template>
    </el-dialog>
</template>

<script setup lang="ts">
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
const props = defineProps(['visible', 'initList']);
const emits = defineEmits(['submit', 'close']);

const show = ref(false);

watch(() => props.visible, async (newValue) => {
    show.value = newValue
    if (newValue) {

    }
}, { deep: true });


// do not use same name with ref


// const handleSubmit = async () => {
//     proxy?.$modal.msgSuccess('操作成功');
//     emits('submit', true);

//     handleClose();
// };


const handleClose = () => {
    emits('close');
};

onMounted(() => {
})
</script>

<style lang="scss" scoped></style>